After completing this lesson, you’ll be able to:
It’s important to cover email notifications in some detail because they are one of the most commonly used protocol types on FME Server.
“Email” is a protocol that may be used by both Trigger and Action components in an Automations workflow. Email Triggers receive incoming emails from external clients, and Email Actions send emails out to an external account.
In fact, email is not a single protocol. There are several methods of email transfer that exist. FME Server supports two of these email-related protocols: SMTP and IMAP.
SMTP (Simple Mail Transfer Protocol) is the ability to directly receive an email through an email server built into FME Server, or indirectly send an email through an SMTP service, for example, a Gmail account.
IMAP (Internet Message Access Protocol) is an indirect process that connects to an email account on a server elsewhere. When that account receives an email, the IMAP protocol passes it on to FME Server.
SMTP Triggers are used when data is sent to FME Server via a direct email. FME Server receives an email and triggers an Action in response.
Such triggers are possible because FME Server includes a built-in email server as one of its components. However, this does require that the hostname and domain of your FME Server should resolve to a publicly accessible IP or DNS.
However, FME Cloud instances are automatically configured for email notifications and have a public domain name too, so you don’t need to do any additional setup.
Creating an SMTP Trigger is done in the Automations > Build Automation section of the FME Server web interface, by choosing the Email - SMTP (received) protocol as a new Trigger.
Once the protocol type is selected, only the Email User Name parameter must be configured. This does not need to be an existing user or email; in the above example, it is set up to be AuthoringCourse. Note that you do not need to specify @FMEServer-Hostname.com in the Email User Name parameter.
To construct the full email address, combine the Email Username with your FMEServer hostname. Now, for this example, whenever an email is sent to AuthoringCourse@YourFMEServerHostname this Automation will receive an incoming message that contains the entire contents of that email, including the from and to address, and any attachments. This information is all processed by FME Server so it can be used to trigger an Action downstream in the workspace.
In the SMTP trigger, there is an Optional Parameter to specify the location to download any email attachments to. If this is not defined, the attachments will still be saved to a temporary location on FME Server.
IMAP (Internet Message Access Protocol) is a variation on email for incoming notifications.
Instead of using the built-in email server, an IMAP Trigger connects to another email server and monitors it for incoming email. When a new email arrives in that account, the Automation is triggered.
Like the SMTP protocol, IMAP Triggers are set up in the Automations > Build Automation section of the web interface by creating a new or adding to an existing Automation, but this time choosing the Email -IMAP (received) protocol:
This Trigger has significantly more parameters, most are for defining the IMAP (Email) server connection.
There are two important parameters that let you decide what and when to watch this Email Server. Poll Interval determines how often FME Server should check for emails. Emails to Fetch decides whether to fetch all unread emails or new emails only.
Like the SMTP Protocol, there is a parameter to select an FME Server resource location in which to store any email attachments.